<%@ page language="java"
         import="com.zhuozhengsoft.pageoffice.BorderStyleType,com.zhuozhengsoft.pageoffice.OpenModeType,com.zhuozhengsoft.pageoffice.PageOfficeCtrl"
         pageEncoding="utf-8" %>
<%@ page import="com.zhuozhengsoft.pageoffice.ThemeType" %>
<%@ page import="com.zhuozhengsoft.pageoffice.wordwriter.WordDocument" %>
<%
    PageOfficeCtrl poCtrl = new PageOfficeCtrl(request);

    WordDocument doc = new WordDocument();
    doc.getTemplate().defineDataTag("{ 甲方 }");
    doc.getTemplate().defineDataTag("{ 乙方 }");
    doc.getTemplate().defineDataTag("{ 担保人 }");
    doc.getTemplate().defineDataTag("【 合同日期 】");
    doc.getTemplate().defineDataTag("【 合同编号 】");
    poCtrl.setWriter(doc);

    poCtrl.setSaveFilePage("SaveFile.jsp");

    poCtrl.webOpen("doc/test.doc", OpenModeType.docNormalEdit, "zhangsan");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
    <script>
        function Save() {
            pageofficectrl.WebSave();
        }

        function ShowDefineDataTags() {
            var dtDefinedJson = pageofficectrl.word.DataTagsDefinedAsJson;
            pageofficectrl.ShowHtmlModelessDialog("DataTagDlg.htm", dtDefinedJson, "left=300px;top=390px;width=400px;height=410px;frame:no;");
        }

        function OnPageOfficeCtrlInit() {
            pageofficectrl.AddCustomToolButton("保存", "Save", 1);
            pageofficectrl.AddCustomToolButton("定义数据标签", "ShowDefineDataTags", 20);
        }

    </script>
</head>
<body>
<form action="">
    <div style="width: auto; height: 1000px;">
        <%=poCtrl.getHtmlCode()%>
    </div>
</form>
</body>
</html>
